<template>
  <div class="NoticeDet">
    <div v-for="(item, index) in list" :key="index" style="display: flex;line-height: 30px;">
      <div style="flex: 1;padding:20px;" v-html="item.description"></div>
    </div>
  </div>
</template>
<script>
export default {
  name: "NoticeDet",
  data() {
    return {
      det: {},
      detData: "",
      list: []
    };
  },
  created() {
    this.post("/integral/get_rule").then(r => {
      this.list = r.list;

      console.log("this.list", this.list);
    });
    // this.detData = this.$route.query.detData;
    // this.detData.description = this.replaceImgs(this.$route.query.detData.description);
    // this.detData.description = this.detData.description.replace(
    //     /\s(width:)/g,
    //     ' width: 100%'
    //   );
    // console.log("notice det", this.detData);
  },
  methods: {
    back() {
      this.$router.isBack = true; // 将返回状态置为触发态，以边路由监听触发返回动画
      this.$router.back(); // 路由向后退一步
    },
    replaceImgs(htmlText) {
      return htmlText.replace(
        /\s(src=")/g,
        ' width="100%" height="150px" src="http://www.hkqwgb.cn:8080'
      );
      // replaceText = htmlText.replace(
      //   /\s(width:)/g,
      //   ' width: 100%'
      // );
      // this.detData.description = replaceText;
      // console.log("replaceText", replaceText);
    }
  }
};
</script>
<style lang="scss" scoped>
@import "~@/smobile.scss";
.NoticeDet {
  .header {
    padding: $sm-spaceing-block-sm 0 $sm-spaceing-block-sm 0;

    position: absolute;
    width: $sm-img-per-max;
    height: 21px;
    background: $sm-bg-color;
    z-index: 2;

    display: flex;
    flex-direction: row nowrap;
    justify-content: flex-start;
    .backIcon {
      position: absolute;
      white-space: nowrap;
      height: $sm-icon-px-md;
      z-index: 4;

      .iconImage {
        height: $sm-icon-px-md;
        width: $sm-icon-px-md;
        transform: rotateY(180deg);
      }
    }

    .theme {
      position: absolute;
      font-weight: bold;
      width: $sm-img-per-max;
      text-align: center;
      white-space: nowrap;
      z-index: 3;
    }
  }

  .outermostMargin {
    padding: $sm-spaceing-block-base;
    background: $sm-bg-color;
    color: $sm-text-color;
    font-size: $sm-font-size-lg;

    overflow: auto;
    height: 100vh;
    // margin: 41px 0 0 0;

    .msgBox {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;

      .textBox {
        .titles {
          display: flex;
          flex-direction: column;
          margin: $sm-spacing-col-xl 0 0 0;

          .mainTitle {
            font-size: $sm-font-size-title;
            font-weight: bold;
            color: $sm-color-title;
          }

          .time {
            padding: $sm-spacing-col-sm 0 $sm-spacing-col-sm 0;
            color: $sm-text-color-grey;
            font-size: $sm-font-size-lg;
          }
        }
      }
      .imgBox {
        width: $sm-img-per-max;
        height: $sm-img-size-maxp;
        background-repeat: no-repeat;
        background-size: cover;
      }
      .summary {
        // margin: $sm-spacing-col-lg 0 $sm-spacing-col-lg 0;
        color: $sm-color-title;
        span,
        p {
          width: 100% !important;
        }
      }
    }
  }
}
</style>